'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  //路由拆分(把路由规则逻辑散落在多个地方，会给排查问题带来困扰)
  require('./router/Example')(app);
  const { router, controller } = app;

  //统一前缀
  const prefix = app.config.AuthPrefix;
  //登录
  router.post(prefix + '/login', controller.user.login.index);
  //获取用户信息
  router.get(prefix + '/Info', controller.user.login.Info);
  //用户管理
  router.resources(prefix + '/usersManage', controller.user.users);
  //菜单树形结构
  router.resources(prefix + '/menu', controller.user.menu);
  //菜单管理
  // router.resources(prefix + '/role', controller.user.role);
};
